package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

public class MainActivityB extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_b);

        // 获取intent对象
        Intent intent = getIntent();
        String name = intent.getStringExtra("studentName");

        Log.i("tag1", name);

        // 设置返回的参数
        Intent intent1 = new Intent();
        intent1.putExtra("num", 100);
        setResult(1, intent1);
    }
}